//
//  DDContentType.m
//  ialone
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 JasperSong. All rights reserved.
//

#import "DDContentType.h"

@implementation DDContentType

// 初始化
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self){
        
        // 毛玻璃效果
        UIBlurEffect *blurEff = [UIBlurEffect effectWithStyle:(UIBlurEffectStyleExtraLight)];
        UIVisualEffectView *visualE = [[UIVisualEffectView alloc]initWithEffect:blurEff];
        visualE.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
        visualE.alpha = 0.5;
        [self addSubview:visualE];
        // 变成圆形
        self.layer.cornerRadius = frame.size.width/2;
        self.layer.masksToBounds = YES;
        
        // 目测位置
        self.button = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.button.frame = CGRectMake(22, 20, 40, 40);
        [self addSubview:self.button];
    }
    return self;
}









/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
